//------------------------------------------------
//		DELAY.c
//	DELAY library
//	Arthur Benemann 28/03/2012
//------------------------------------------------
//	Description:
//  Delays functions.
//-----------------------------------------------
//	Requeriments:
//-----------------------------------------------
#include "picDev.h"

//---------------- Functions ---------------------
void delayms( unsigned t)
{
    T1CON = 0x8000;     // enable tmr1, Internal clock (FOSC/2), 1:1
    while (t--)
    {
        TMR1 = 0;
        while (TMR1< GetPeripheralClock()/1000);
    }
} // Delayms

void delayus( unsigned t)
{
    T1CON = 0x8000;     // enable tmr1, Internal clock (FOSC/2), 1:1
    while (t--)
    {
        TMR1 = 0;
        while (TMR1< GetPeripheralClock()/1000000);
    }
} // Delayms

